
<?php

//by ralvear 20130811

class Postgres
{
	private $_postgres;

	public function __construct()
	{

		$bd = pg_connect(
			' dbname= '. BD_NOMBRE .' port= '. BD_PUERTO .' host= '. BD_HOST .' user= '. BD_USUARIO .' password= '. BD_CLAVE );   

		$this->_postgres = $bd;
	}

	public function obtenerPostgres()
	{
		return $this->_postgres;
	}

	public function cerrarPostgres( $bd )
	{   
		if( $bd ){
			pg_close( $bd );
		}
		
	}

}

?>